spinbutton: Make the swipe gesture only work on touch devices
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 11 Aug 2014 19:54:39 +0000 (21:54 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 15 Aug 2014 11:53:39 +0000 (13:53 +0200)
This code was relying on the previous GtkGestureSingle::touch-only default
value.

https://bugzilla.gnome.org/show_bug.cgi?id=734285

gtk/gtkspinbutton.c

index ddd4540dc94737e44814024c88c9fc29db996ff1..770f242adbb93857f7e00288ef0a0df876d4e6be 100644 (file)
@@ -724,6 +724,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button)
   gtk_widget_add_events (GTK_WIDGET (spin_button), GDK_SCROLL_MASK);
 
   priv->swipe_gesture = gtk_gesture_swipe_new (GTK_WIDGET (spin_button));
+  gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->swipe_gesture), TRUE);
   gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->swipe_gesture),
                                               GTK_PHASE_CAPTURE);
   g_signal_connect (priv->swipe_gesture, "begin",